import React, { Component } from 'react'
import { addshoucang, getMsg, appyuding } from '../../../redux/actionCreator'
import { withRouter } from 'react-router-dom'
import { connect } from 'react-redux'
const detail = (bus, comm, props) => {
    return <div className="details">
        <div style={{ textIndent: '2em', lineHeight: '1.4em' }}>{bus.business_describe}</div>
        <div style={{ height: '2em' }}>
        </div>
        <div>营业时间：{comm.commodity_time}</div>
        <div>平均费用：{comm.commodity_money}/人</div>
        <div>联系电话：{bus.business_phone}</div>
    </div>
}

class Details extends Component {
    constructor(props) {
        super(props);
    }
    render() {
        // console.log(JSON.parse(localStorage.getItem('commoditydetail')));
        return (
            <div style={{ width: '90%', margin: '0 auto', marginBottom: '6em' }}>
                {detail(JSON.parse(localStorage.getItem('busdetail')), JSON.parse(localStorage.getItem('commoditydetail')), this.props)}
            </div>
        )
    }
}

const mapStateToProps = (state) => (
    {
        shop: state.shop,
        shoucang: state.shoucang,
        login: state.login
    }
)
export default withRouter(connect(mapStateToProps)(Details))